import React from "react";

class Hello extends React.Component {
  static defaultProps = {
    name: "张三",
  };

  render() {
    console.log(this, "Hello");
    return <div>Hello, {this.props.name}</div>;
  }
}

// Hello.defaultProps = {
//   name: "张三",
// };

function World({ name = "里斯" }) {
  return <div>World, {name}</div>;
}

// World.defaultProps = {
//   name: "里斯",
// };

class App extends React.Component {
  render() {
    return (
      <div>
        <h1>App</h1>

        <Hello />
        <World />
      </div>
    );
  }
}

export default App;
